# gdmap
# Builds from https://github.com/puppylinux-woof-CE/petbuilds
# File auto generated by ./mk_petbuild.sh. Edit as necessary.

. ../func
. ../build.conf

URL=http://downloads.sourceforge.net/project/gdmap/gdmap/0.8.1
PKG=gdmap
VER=0.8.1
COMP=tar.gz
DESC="graphical disc usage"
DEPS=
CAT=Utility
DESKTOP=gdmap.desktop
BUILD=
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
# comment these 2 below if you use a custom package() function
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not

ARCH=$(uname -m)
case $ARCH in # set in build.conf
 *64) 	LIBDIR=$LIBCONF64 
		FLAGS="-fPIC -lm";;
 arm*)	LIBDIR=$LIBCONFarm
		FLAGS="-lm";;
 *) 	LIBDIR=$LIBCONF32 
		FLAGS="-lm";;
esac

patch_me() {
	for i in *.patch;do
		(cd ${PKG}-${VER}/src; patch -p0 < ../../$i) || exit 1
	done
	(cd ${PKG}-${VER}; sed -i s/-DGTK_DISABLE_DEPRECATED//g configure) || exit 1
}

build() {
	(cd ${PKG}-${VER}
	CFLAGS="$FLAGS" \
	./configure --prefix=/usr \
				--libdir=/usr/${LIBDIR} \
				--sysconfdir=/etc \
				--localstatedir=/var
	make $MKFLG || exit 1
	make DESTDIR=${CWD}/${PKG}-install install
	)
}

# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}
patch_me
build
package_std $PKG $VER $ARCH $DESKTOP "$DESC" $DEPS $CAT
